import type { EnemyDummy } from './EnemyDummy';

const registry = new Map<string, EnemyDummy>();

export const EnemyRegistry = {
  register(id: string, enemy: EnemyDummy) {
    registry.set(id, enemy);
  },
  unregister(id: string) {
    registry.delete(id);
  },
  get(id: string): EnemyDummy | undefined {
    return registry.get(id);
  },
  entries(): IterableIterator<[string, EnemyDummy]> {
    return registry.entries();
  },
  clear() {
    registry.clear();
  },
};

